Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Add terminal toggle button and resilient clipboard copy handling#28

Merged
rexlManu merged 1 commit intomainfrom
t3code/terminal-button-and-copy
Mar 9, 2026
Merged

Add terminal toggle button and resilient clipboard copy handling#28
rexlManu merged 1 commit intomainfrom
t3code/terminal-button-and-copy

Conversation

@rexlManu
Copy link
Copy Markdown
Owner

@rexlManu rexlManu commented Mar 9, 2026

Summary

  • Add a terminal toggle button to the chat header with dynamic label, shortcut hint, and proper disabled/accessibility states.
  • Introduce shared copyTextToClipboard utility with Clipboard API support plus execCommand fallback.
  • Reuse shared clipboard utility in chat message copy and sidebar flows to remove duplicate logic.
  • Add terminal key handling for copying selected text (Cmd+C on macOS, Ctrl+C/Ctrl+Shift+C on non-macOS) without breaking terminal navigation shortcuts.
  • Add unit tests for isTerminalSelectionCopyShortcut across macOS/non-macOS and modifier edge cases.

Testing

  • Not run (in this PR description context).
  • Added automated coverage in apps/web/src/terminalKeyboard.test.ts for terminal copy shortcut behavior.
  • Recommended checks before merge: bun lint and bun typecheck.

- add a chat toolbar button to open/hide the terminal with shortcut-aware labels
- centralize clipboard copy logic with a fallback when Clipboard API is unavailable
- handle terminal selection copy shortcuts and add tests for platform-specific behavior
@rexlManu rexlManu merged commit f4063e9 into main Mar 9, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant